//
//  ATBReFundListModel.m
//  quxiangtao
//
//  Created by E人一铺 on 2019/3/20.
//  Copyright © 2019年 shanhaijin. All rights reserved.
//

#import "ATBReFundListModel.h"

@implementation ATBReFundListModel

+ (void)refundListRequestWithPage:(NSInteger)page successBlock:(HttpRequestSuccess)successBlock failBlock:(HttpRequestFailed)failBlock{
    NSString *str = [NSString stringWithFormat:@"{\"userid\" : \"%@\", \"page\" : \"%@\", \"number\" : \"%@\"}",  [RSA encryptString:[CommonUserInfo sharedInstance].user_id publicKey:PublicKey], [RSA encryptString:[NSString stringWithFormat:@"%zd", page] publicKey:PublicKey], [RSA encryptString:@"10" publicKey:PublicKey]];
    
    [PPNetworkHelper POST:@"bargain/orderlist/refundOrderList" parameters:@{@"json" : str} success:^(id responseObject) {
       
        NSArray *array = [NSArray arrayWithArray:responseObject[@"data"]];
        
        NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithDictionary:responseObject];
        if (array.count > 0) {
            
            NSArray *modelArr = [ATBReFundListModel mj_objectArrayWithKeyValuesArray:array];
            
            [dict removeObjectForKey:@"data"];
            [dict setObject:modelArr forKey:@"data"];
        }
        
        if (successBlock) {
            
            successBlock(dict);
        }
        
        
    } failure:^(NSError *error) {
        if (failBlock) {
            
            failBlock(error);
        }
    }];
}
@end
